.connection {
  overflow: visible;
  pointer-events: stroke;
  /* 确保线条在卡片下方 */
  z-index: 1;
}

.connection path {
  stroke-linecap: round;
  stroke-linejoin: round; /* 平滑连接处 */
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
  /* 增加阴影效果，提升立体感 */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
  /* 增加点击区域 */
  stroke-miterlimit: 10;
  stroke-dasharray: none;
  /* 确保线条可以接收鼠标事件 */
  pointer-events: stroke;
  cursor: pointer;
}

.connection.selected path {
  stroke: #4285f4;
  stroke-width: 3px;
}

.connection:hover path {
  stroke: #666;
}

/* 添加连接线高亮样式 */
.connection.highlighted path {
  stroke-width: 2px;
  stroke-opacity: 0.8;
}

.connection.highlighted.selected path {
  stroke: #4285f4;
  stroke-width: 4px;
  stroke-opacity: 1;
}

/* 连接线选择模式下的样式 */
.connection-selection-mode .connection path {
  stroke-width: 2.5px;
  transition: stroke-width 0.3s ease, stroke 0.3s ease;
}

.connection-selection-mode .connection:hover path {
  stroke: #888;
  stroke-width: 3px;
}

/* 在连接线选择模式下淡化卡片 */
.infinite-canvas.connection-selection-mode .card:not(.selected) {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.infinite-canvas.connection-selection-mode .card.selected {
  border: 2px solid #4285f4;
}

/* 连接线标签样式 - 移除边框和背景 */
.connection-label-container {
  pointer-events: none;
  z-index: 5; /* 确保标签在卡片之上 */
}

/* 普通文本标签样式 - 不带边框和背景，半透明 */
.connection-label-text {
  color: #333;
  font-size: 14px;
  padding: 2px 4px;
  pointer-events: auto;
  user-select: none;
  text-shadow: 0px 0px 3px white;
  opacity: 0.9;
}

.connection-label-text.selected {
  color: #4285f4;
  font-weight: bold;
}

/* 输入框样式 */
.connection-label-input {
  background-color: white;
  border: 1px solid #4285f4;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
  pointer-events: auto;
  z-index: 6;
  min-width: 60px;
  text-align: center;
}

/* 添加箭头样式 */
.connection marker path {
  transition: fill 0.2s ease;
  stroke: none; /* 移除描边 */
}

.connection.selected marker path {
  fill: #4285f4;
}

/* 不同箭头类型的连接线样式 */
.connection.arrow-none path {
  stroke-dasharray: none;
}

.connection.arrow-end path {
  stroke-dasharray: none;
}

.connection.arrow-start path {
  stroke-dasharray: none;
}

.connection.arrow-both path {
  stroke-dasharray: none;
}

/* 添加指示器样式 */
.arrow-type-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(66, 133, 244, 0.9);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.keyboard-hint {
  opacity: 0.8;
  font-size: 12px;
  margin-left: 8px;
}
